var provinces = {
    citys: [
        {
            id: 36,
            city: "安庆市",
            pinyin: "an qing shi"
        },
        {
            id: 37,
            city: "蚌埠市",
            pinyin: "bang bu shi"
        },
        {
            id: 38,
            city: "巢湖市",
            pinyin: "chao hu shi"
        },
        {
            id: 39,
            city: "池州市",
            pinyin: "chi zhou shi"
        },
        {
            id: 40,
            city: "滁州市",
            pinyin: "chu zhou shi"
        },
        {
            id: 41,
            city: "阜阳市",
            pinyin: "fu yang shi"
        },
        {
            id: 42,
            city: "淮北市",
            pinyin: "huai bei shi"
        },
        {
            id: 43,
            city: "淮南市",
            pinyin: "huai nan shi"
        },
        {
            id: 44,
            city: "黄山市",
            pinyin: "huang shan shi"
        },
        {
            id: 45,
            city: "六安市",
            pinyin: "liu an shi"
        },
        {
            id: 46,
            city: "马鞍山市",
            pinyin: "ma an shan shi"
        },
        {
            id: 47,
            city: "宿州市",
            pinyin: "su zhou shi"
        },
        {
            id: 48,
            city: "铜陵市",
            pinyin: "tong ling shi"
        },
        {
            id: 49,
            city: "芜湖市",
            pinyin: "wu hu shi"
        },
        {
            id: 50,
            city: "宣城市",
            pinyin: "xuan cheng shi"
        },
        {
            id: 51,
            city: "亳州市",
            pinyin: "bo zhou shi"
        },
        {
            id: 53,
            city: "福州市",
            pinyin: "fu zhou shi"
        },
        {
            id: 54,
            city: "龙岩市",
            pinyin: "long yan shi"
        },
        {
            id: 55,
            city: "南平市",
            pinyin: "nan ping shi"
        },
        {
            id: 56,
            city: "宁德市",
            pinyin: "ning de shi"
        },
        {
            id: 57,
            city: "莆田市",
            pinyin: "pu tian shi"
        },
        {
            id: 58,
            city: "泉州市",
            pinyin: "quan zhou shi"
        },
        {
            id: 59,
            city: "三明市",
            pinyin: "san ming shi"
        },
        {
            id: 60,
            city: "厦门市",
            pinyin: "xia men shi"
        },
        {
            id: 61,
            city: "漳州市",
            pinyin: "zhang zhou shi"
        },
        {
            id: 62,
            city: "兰州市",
            pinyin: "lan zhou shi"
        },
        {
            id: 63,
            city: "白银市",
            pinyin: "bai yin shi"
        },
        {
            id: 64,
            city: "定西市",
            pinyin: "ding xi shi"
        },
        {
            id: 65,
            city: "甘南藏族自治州",
            pinyin: "Gan Nan Cang Zu Zi Zhi Zhou "
        },
        {
            id: 66,
            city: "嘉峪关市",
            pinyin: "jia yu guan shi"
        },
        {
            id: 67,
            city: "金昌市",
            pinyin: "jin chang shi"
        },
        {
            id: 68,
            city: "酒泉市",
            pinyin: "jiu quan shi"
        },
        {
            id: 69,
            city: "临夏回族自治州",
            pinyin: "Lin Xia Hui Zu Zi Zhi Zhou "
        },
        {
            id: 70,
            city: "陇南市",
            pinyin: "long nan shi"
        },
        {
            id: 71,
            city: "平凉市",
            pinyin: "ping liang shi"
        },
        {
            id: 72,
            city: "庆阳市",
            pinyin: "qing yang shi"
        },
        {
            id: 73,
            city: "天水市",
            pinyin: "tian shui shi"
        },
        {
            id: 74,
            city: "武威市",
            pinyin: "wu wei shi"
        },
        {
            id: 75,
            city: "张掖市",
            pinyin: "zhang ye shi"
        },
        {
            id: 76,
            city: "广州市",
            pinyin: "guang zhou shi"
        },
        {
            id: 77,
            city: "深圳市",
            pinyin: "shen zhen shi"
        },
        {
            id: 78,
            city: "潮州市",
            pinyin: "chao zhou shi"
        },
        {
            id: 79,
            city: "东莞市",
            pinyin: "dong guan shi"
        },
        {
            id: 80,
            city: "佛山市",
            pinyin: "fo shan shi"
        },
        {
            id: 81,
            city: "河源市",
            pinyin: "he yuan shi"
        },
        {
            id: 82,
            city: "惠州市",
            pinyin: "hui zhou shi"
        },
        {
            id: 83,
            city: "江门市",
            pinyin: "jiang men shi"
        },
        {
            id: 84,
            city: "揭阳市",
            pinyin: "jie yang shi"
        },
        {
            id: 85,
            city: "茂名市",
            pinyin: "mao ming shi"
        },
        {
            id: 86,
            city: "梅州市",
            pinyin: "mei zhou shi"
        },
        {
            id: 87,
            city: "清远市",
            pinyin: "qing yuan shi"
        },
        {
            id: 88,
            city: "汕头市",
            pinyin: "shan tou shi"
        },
        {
            id: 89,
            city: "汕尾市",
            pinyin: "shan wei shi"
        },
        {
            id: 90,
            city: "韶关市",
            pinyin: "shao guan shi"
        },
        {
            id: 91,
            city: "阳江市",
            pinyin: "yang jiang shi"
        },
        {
            id: 92,
            city: "云浮市",
            pinyin: "yun fu shi"
        },
        {
            id: 93,
            city: "湛江市",
            pinyin: "zhan jiang shi"
        },
        {
            id: 94,
            city: "肇庆市",
            pinyin: "zhao qing shi"
        },
        {
            id: 95,
            city: "中山市",
            pinyin: "zhong shan shi"
        },
        {
            id: 96,
            city: "珠海市",
            pinyin: "zhu hai shi"
        },
        {
            id: 97,
            city: "南宁市",
            pinyin: "nan ning shi"
        },
        {
            id: 98,
            city: "桂林市",
            pinyin: "gui lin shi"
        },
        {
            id: 99,
            city: "百色市",
            pinyin: "bai se shi"
        },
        {
            id: 100,
            city: "北海市",
            pinyin: "bei hai shi"
        },
        {
            id: 101,
            city: "崇左市",
            pinyin: "chong zuo shi"
        },
        {
            id: 102,
            city: "防城港市",
            pinyin: "fang cheng gang shi"
        },
        {
            id: 103,
            city: "贵港市",
            pinyin: "gui gang shi"
        },
        {
            id: 104,
            city: "河池市",
            pinyin: "he chi shi"
        },
        {
            id: 105,
            city: "贺州市",
            pinyin: "he zhou shi"
        },
        {
            id: 106,
            city: "来宾市",
            pinyin: "lai bin shi"
        },
        {
            id: 107,
            city: "柳州市",
            pinyin: "liu zhou shi"
        },
        {
            id: 108,
            city: "钦州市",
            pinyin: "qin zhou shi"
        },
        {
            id: 109,
            city: "梧州市",
            pinyin: "wu zhou shi"
        },
        {
            id: 110,
            city: "玉林市",
            pinyin: "yu lin shi"
        },
        {
            id: 111,
            city: "贵阳市",
            pinyin: "gui yang shi"
        },
        {
            id: 112,
            city: "安顺市",
            pinyin: "an shun shi"
        },
        {
            id: 113,
            city: "毕节市",
            pinyin: "bi jie shi"
        },
        {
            id: 114,
            city: "六盘水市",
            pinyin: "liu pan shui shi"
        },
        {
            id: 115,
            city: "黔东南苗族侗族自治州",
            pinyin: "Qian Dong Nan Miao Zu Dong Zu Zi Zhi Zhou "
        },
        {
            id: 116,
            city: "黔南布依族苗族自治州",
            pinyin: "Qian Nan Bu Yi Zu Miao Zu Zi Zhi Zhou "
        },
        {
            id: 117,
            city: "黔西南布依族苗族自治州",
            pinyin: "Qian Xi Nan Bu Yi Zu Miao Zu Zi Zhi Zhou "
        },
        {
            id: 118,
            city: "铜仁市",
            pinyin: "tong ren shi"
        },
        {
            id: 119,
            city: "遵义市",
            pinyin: "zun yi shi"
        },
        {
            id: 120,
            city: "海口市",
            pinyin: "hai kou shi"
        },
        {
            id: 121,
            city: "三亚市",
            pinyin: "san ya shi"
        },
        {
            id: 122,
            city: "白沙黎族自治县",
            pinyin: "Bai Sha Li Zu Zi Zhi Xian "
        },
        {
            id: 123,
            city: "保亭黎族苗族自治县",
            pinyin: "Bao Ting Li Zu Miao Zu Zi Zhi Xian "
        },
        {
            id: 124,
            city: "昌江黎族自治县",
            pinyin: "Chang Jiang Li Zu Zi Zhi Xian "
        },
        {
            id: 125,
            city: "澄迈县",
            pinyin: "cheng mai xian"
        },
        {
            id: 126,
            city: "定安县",
            pinyin: "ding an xian"
        },
        {
            id: 127,
            city: "东方市",
            pinyin: "dong fang shi"
        },
        {
            id: 128,
            city: "乐东黎族自治县",
            pinyin: "Le Dong Li Zu Zi Zhi Xian "
        },
        {
            id: 129,
            city: "临高县",
            pinyin: "lin gao xian"
        },
        {
            id: 130,
            city: "陵水黎族自治县",
            pinyin: "Ling Shui Li Zu Zi Zhi Xian "
        },
        {
            id: 131,
            city: "琼海市",
            pinyin: "qiong hai shi"
        },
        {
            id: 132,
            city: "琼中黎族苗族自治县",
            pinyin: "Qiong Zhong Li Zu Miao Zu Zi Zhi Xian "
        },
        {
            id: 133,
            city: "屯昌县",
            pinyin: "tun chang xian"
        },
        {
            id: 134,
            city: "万宁市",
            pinyin: "wan ning shi"
        },
        {
            id: 135,
            city: "文昌市",
            pinyin: "wen chang shi"
        },
        {
            id: 136,
            city: "五指山市",
            pinyin: "wu zhi shan shi"
        },
        {
            id: 137,
            city: "儋州市",
            pinyin: "dan zhou shi"
        },
        {
            id: 138,
            city: "石家庄市",
            pinyin: "shi jia zhuang shi"
        },
        {
            id: 139,
            city: "保定市",
            pinyin: "bao ding shi"
        },
        {
            id: 140,
            city: "沧州市",
            pinyin: "cang zhou shi"
        },
        {
            id: 141,
            city: "承德市",
            pinyin: "cheng de shi"
        },
        {
            id: 142,
            city: "邯郸市",
            pinyin: "han dan shi"
        },
        {
            id: 143,
            city: "衡水市",
            pinyin: "heng shui shi"
        },
        {
            id: 144,
            city: "廊坊市",
            pinyin: "lang fang shi"
        },
        {
            id: 145,
            city: "秦皇岛市",
            pinyin: "qin huang dao shi"
        },
        {
            id: 146,
            city: "唐山市",
            pinyin: "tang shan shi"
        },
        {
            id: 147,
            city: "邢台市",
            pinyin: "xing tai shi"
        },
        {
            id: 148,
            city: "张家口市",
            pinyin: "zhang jia kou shi"
        },
        {
            id: 149,
            city: "郑州市",
            pinyin: "zheng zhou shi"
        },
        {
            id: 150,
            city: "洛阳市",
            pinyin: "luo yang shi"
        },
        {
            id: 151,
            city: "开封市",
            pinyin: "kai feng shi"
        },
        {
            id: 152,
            city: "安阳市",
            pinyin: "an yang shi"
        },
        {
            id: 153,
            city: "鹤壁市",
            pinyin: "he bi shi"
        },
        {
            id: 154,
            city: "济源市",
            pinyin: "ji yuan shi"
        },
        {
            id: 155,
            city: "焦作市",
            pinyin: "jiao zuo shi"
        },
        {
            id: 156,
            city: "南阳市",
            pinyin: "nan yang shi"
        },
        {
            id: 157,
            city: "平顶山市",
            pinyin: "ping ding shan shi"
        },
        {
            id: 158,
            city: "三门峡市",
            pinyin: "san men xia shi"
        },
        {
            id: 159,
            city: "商丘市",
            pinyin: "shang qiu shi"
        },
        {
            id: 160,
            city: "新乡市",
            pinyin: "xin xiang shi"
        },
        {
            id: 161,
            city: "信阳市",
            pinyin: "xin yang shi"
        },
        {
            id: 162,
            city: "许昌市",
            pinyin: "xu chang shi"
        },
        {
            id: 163,
            city: "周口市",
            pinyin: "zhou kou shi"
        },
        {
            id: 164,
            city: "驻马店市",
            pinyin: "zhu ma dian shi"
        },
        {
            id: 165,
            city: "漯河市",
            pinyin: "luo he shi"
        },
        {
            id: 166,
            city: "濮阳市",
            pinyin: "pu yang shi"
        },
        {
            id: 167,
            city: "哈尔滨市",
            pinyin: "ha er bin shi"
        },
        {
            id: 168,
            city: "大庆市",
            pinyin: "da qing shi"
        },
        {
            id: 169,
            city: "大兴安岭地区",
            pinyin: "Da Xing An Ling Di Qu "
        },
        {
            id: 170,
            city: "鹤岗市",
            pinyin: "he gang shi"
        },
        {
            id: 171,
            city: "黑河市",
            pinyin: "hei he shi"
        },
        {
            id: 172,
            city: "鸡西市",
            pinyin: "ji xi shi"
        },
        {
            id: 173,
            city: "佳木斯市",
            pinyin: "jia mu si shi"
        },
        {
            id: 174,
            city: "牡丹江市",
            pinyin: "mu dan jiang shi"
        },
        {
            id: 175,
            city: "七台河市",
            pinyin: "qi tai he shi"
        },
        {
            id: 176,
            city: "齐齐哈尔市",
            pinyin: "qi qi ha er shi"
        },
        {
            id: 177,
            city: "双鸭山市",
            pinyin: "shuang ya shan shi"
        },
        {
            id: 178,
            city: "绥化市",
            pinyin: "sui hua shi"
        },
        {
            id: 179,
            city: "伊春市",
            pinyin: "yi chun shi"
        },
        {
            id: 180,
            city: "武汉市",
            pinyin: "wu han shi"
        },
        {
            id: 181,
            city: "仙桃市",
            pinyin: "xian tao shi"
        },
        {
            id: 182,
            city: "鄂州市",
            pinyin: "e zhou shi"
        },
        {
            id: 183,
            city: "黄冈市",
            pinyin: "huang gang shi"
        },
        {
            id: 184,
            city: "黄石市",
            pinyin: "huang shi shi"
        },
        {
            id: 185,
            city: "荆门市",
            pinyin: "jing men shi"
        },
        {
            id: 186,
            city: "荆州市",
            pinyin: "jing zhou shi"
        },
        {
            id: 187,
            city: "潜江市",
            pinyin: "qian jiang shi"
        },
        {
            id: 188,
            city: "神农架林区",
            pinyin: "shen nong jia lin qu"
        },
        {
            id: 189,
            city: "十堰市",
            pinyin: "shi yan shi"
        },
        {
            id: 190,
            city: "随州市",
            pinyin: "sui zhou shi"
        },
        {
            id: 191,
            city: "天门市",
            pinyin: "tian men shi"
        },
        {
            id: 192,
            city: "咸宁市",
            pinyin: "xian ning shi"
        },
        {
            id: 193,
            city: "襄樊市",
            pinyin: "xiang fan shi"
        },
        {
            id: 194,
            city: "孝感市",
            pinyin: "xiao gan shi"
        },
        {
            id: 195,
            city: "宜昌市",
            pinyin: "yi chang shi"
        },
        {
            id: 196,
            city: "恩施市",
            pinyin: "en shi shi"
        },
        {
            id: 197,
            city: "长沙市",
            pinyin: "chang sha shi"
        },
        {
            id: 198,
            city: "张家界市",
            pinyin: "zhang jia jie shi"
        },
        {
            id: 199,
            city: "常德市",
            pinyin: "chang de shi"
        },
        {
            id: 200,
            city: "郴州市",
            pinyin: "chen zhou shi"
        },
        {
            id: 201,
            city: "衡阳市",
            pinyin: "heng yang shi"
        },
        {
            id: 202,
            city: "怀化市",
            pinyin: "huai hua shi"
        },
        {
            id: 203,
            city: "娄底市",
            pinyin: "lou di shi"
        },
        {
            id: 204,
            city: "邵阳市",
            pinyin: "shao yang shi"
        },
        {
            id: 205,
            city: "湘潭市",
            pinyin: "xiang tan shi"
        },
        {
            id: 206,
            city: "湘西土家族苗族自治州",
            pinyin: "Xiang Xi Tu Jia Zu Miao Zu Zi Zhi Zhou "
        },
        {
            id: 207,
            city: "益阳市",
            pinyin: "yi yang shi"
        },
        {
            id: 208,
            city: "永州市",
            pinyin: "yong zhou shi"
        },
        {
            id: 209,
            city: "岳阳市",
            pinyin: "yue yang shi"
        },
        {
            id: 210,
            city: "株洲市",
            pinyin: "zhu zhou shi"
        },
        {
            id: 211,
            city: "长春市",
            pinyin: "chang chun shi"
        },
        {
            id: 212,
            city: "吉林市",
            pinyin: "ji lin shi"
        },
        {
            id: 213,
            city: "白城市",
            pinyin: "bai cheng shi"
        },
        {
            id: 214,
            city: "白山市",
            pinyin: "bai shan shi"
        },
        {
            id: 215,
            city: "辽源市",
            pinyin: "liao yuan shi"
        },
        {
            id: 216,
            city: "四平市",
            pinyin: "si ping shi"
        },
        {
            id: 217,
            city: "松原市",
            pinyin: "song yuan shi"
        },
        {
            id: 218,
            city: "通化市",
            pinyin: "tong hua shi"
        },
        {
            id: 219,
            city: "延边朝鲜族自治州",
            pinyin: "Yan Bian Chao Xian Zu Zi Zhi Zhou "
        },
        {
            id: 220,
            city: "南京市",
            pinyin: "nan jing shi"
        },
        {
            id: 221,
            city: "苏州市",
            pinyin: "su zhou shi"
        },
        {
            id: 222,
            city: "无锡市",
            pinyin: "wu xi shi"
        },
        {
            id: 223,
            city: "常州市",
            pinyin: "chang zhou shi"
        },
        {
            id: 224,
            city: "淮安市",
            pinyin: "huai an shi"
        },
        {
            id: 225,
            city: "连云港市",
            pinyin: "lian yun gang shi"
        },
        {
            id: 226,
            city: "南通市",
            pinyin: "nan tong shi"
        },
        {
            id: 227,
            city: "宿迁市",
            pinyin: "su qian shi"
        },
        {
            id: 228,
            city: "泰州市",
            pinyin: "tai zhou shi"
        },
        {
            id: 229,
            city: "徐州市",
            pinyin: "xu zhou shi"
        },
        {
            id: 230,
            city: "盐城市",
            pinyin: "yan cheng shi"
        },
        {
            id: 231,
            city: "扬州市",
            pinyin: "yang zhou shi"
        },
        {
            id: 232,
            city: "镇江市",
            pinyin: "zhen jiang shi"
        },
        {
            id: 233,
            city: "南昌市",
            pinyin: "nan chang shi"
        },
        {
            id: 234,
            city: "抚州市",
            pinyin: "fu zhou shi"
        },
        {
            id: 235,
            city: "赣州市",
            pinyin: "gan zhou shi"
        },
        {
            id: 236,
            city: "吉安市",
            pinyin: "ji an shi"
        },
        {
            id: 237,
            city: "景德镇市",
            pinyin: "jing de zhen shi"
        },
        {
            id: 238,
            city: "九江市",
            pinyin: "jiu jiang shi"
        },
        {
            id: 239,
            city: "萍乡市",
            pinyin: "ping xiang shi"
        },
        {
            id: 240,
            city: "上饶市",
            pinyin: "shang rao shi"
        },
        {
            id: 241,
            city: "新余市",
            pinyin: "xin yu shi"
        },
        {
            id: 242,
            city: "宜春市",
            pinyin: "yi chun shi"
        },
        {
            id: 243,
            city: "鹰潭市",
            pinyin: "ying tan shi"
        },
        {
            id: 244,
            city: "沈阳市",
            pinyin: "shen yang shi"
        },
        {
            id: 245,
            city: "大连市",
            pinyin: "da lian shi"
        },
        {
            id: 246,
            city: "鞍山市",
            pinyin: "an shan shi"
        },
        {
            id: 247,
            city: "本溪市",
            pinyin: "ben xi shi"
        },
        {
            id: 248,
            city: "朝阳市",
            pinyin: "chao yang shi"
        },
        {
            id: 249,
            city: "丹东市",
            pinyin: "dan dong shi"
        },
        {
            id: 250,
            city: "抚顺市",
            pinyin: "fu shun shi"
        },
        {
            id: 251,
            city: "阜新市",
            pinyin: "fu xin shi"
        },
        {
            id: 252,
            city: "葫芦岛市",
            pinyin: "hu lu dao shi"
        },
        {
            id: 253,
            city: "锦州市",
            pinyin: "jin zhou shi"
        },
        {
            id: 254,
            city: "辽阳市",
            pinyin: "liao yang shi"
        },
        {
            id: 255,
            city: "盘锦市",
            pinyin: "pan jin shi"
        },
        {
            id: 256,
            city: "铁岭市",
            pinyin: "tie ling shi"
        },
        {
            id: 257,
            city: "营口市",
            pinyin: "ying kou shi"
        },
        {
            id: 258,
            city: "呼和浩特市",
            pinyin: "hu he hao te shi"
        },
        {
            id: 259,
            city: "阿拉善盟",
            pinyin: "A La Shan Meng "
        },
        {
            id: 260,
            city: "巴彦淖尔市",
            pinyin: "Ba Yan Nao Er Shi "
        },
        {
            id: 261,
            city: "包头市",
            pinyin: "bao tou shi"
        },
        {
            id: 262,
            city: "赤峰市",
            pinyin: "chi feng shi"
        },
        {
            id: 263,
            city: "鄂尔多斯市",
            pinyin: "e er duo si shi"
        },
        {
            id: 264,
            city: "呼伦贝尔市",
            pinyin: "hu lun bei er shi"
        },
        {
            id: 265,
            city: "通辽市",
            pinyin: "tong liao shi"
        },
        {
            id: 266,
            city: "乌海市",
            pinyin: "wu hai shi"
        },
        {
            id: 267,
            city: "乌兰察布市",
            pinyin: "Wu Lan Cha Bu Shi "
        },
        {
            id: 268,
            city: "锡林郭勒盟",
            pinyin: "Xi Lin Guo Le Meng "
        },
        {
            id: 269,
            city: "兴安盟",
            pinyin: "Xing An Meng "
        },
        {
            id: 270,
            city: "银川市",
            pinyin: "yin chuan shi"
        },
        {
            id: 271,
            city: "固原市",
            pinyin: "gu yuan shi"
        },
        {
            id: 272,
            city: "石嘴山市",
            pinyin: "shi zui shan shi"
        },
        {
            id: 273,
            city: "吴忠市",
            pinyin: "wu zhong shi"
        },
        {
            id: 274,
            city: "中卫市",
            pinyin: "zhong wei shi"
        },
        {
            id: 275,
            city: "西宁市",
            pinyin: "xi ning shi"
        },
        {
            id: 276,
            city: "果洛藏族自治州",
            pinyin: "Guo Luo Cang Zu Zi Zhi Zhou "
        },
        {
            id: 277,
            city: "海北藏族自治州",
            pinyin: "Hai Bei Cang Zu Zi Zhi Zhou "
        },
        {
            id: 278,
            city: "海东地区",
            pinyin: "Hai Dong Di Qu "
        },
        {
            id: 279,
            city: "海南藏族自治州",
            pinyin: "Hai Nan Cang Zu Zi Zhi Zhou "
        },
        {
            id: 280,
            city: "海西蒙古族藏族自治州",
            pinyin: "Hai Xi Meng Gu Zu Cang Zu Zi Zhi Zhou "
        },
        {
            id: 281,
            city: "黄南藏族自治州",
            pinyin: "Huang Nan Cang Zu Zi Zhi Zhou "
        },
        {
            id: 282,
            city: "玉树藏族自治州",
            pinyin: "Yu Shu Cang Zu Zi Zhi Zhou "
        },
        {
            id: 283,
            city: "济南市",
            pinyin: "ji nan shi"
        },
        {
            id: 284,
            city: "青岛市",
            pinyin: "qing dao shi"
        },
        {
            id: 285,
            city: "滨州市",
            pinyin: "bin zhou shi"
        },
        {
            id: 286,
            city: "德州市",
            pinyin: "de zhou shi"
        },
        {
            id: 287,
            city: "东营市",
            pinyin: "dong ying shi"
        },
        {
            id: 288,
            city: "菏泽市",
            pinyin: "he ze shi"
        },
        {
            id: 289,
            city: "济宁市",
            pinyin: "ji ning shi"
        },
        {
            id: 290,
            city: "莱芜市",
            pinyin: "lai wu shi"
        },
        {
            id: 291,
            city: "聊城市",
            pinyin: "liao cheng shi"
        },
        {
            id: 292,
            city: "临沂市",
            pinyin: "lin yi shi"
        },
        {
            id: 293,
            city: "日照市",
            pinyin: "ri zhao shi"
        },
        {
            id: 294,
            city: "泰安市",
            pinyin: "tai an shi"
        },
        {
            id: 295,
            city: "威海市",
            pinyin: "wei hai shi"
        },
        {
            id: 296,
            city: "潍坊市",
            pinyin: "wei fang shi"
        },
        {
            id: 297,
            city: "烟台市",
            pinyin: "yan tai shi"
        },
        {
            id: 298,
            city: "枣庄市",
            pinyin: "zao zhuang shi"
        },
        {
            id: 299,
            city: "淄博市",
            pinyin: "zi bo shi"
        },
        {
            id: 300,
            city: "太原市",
            pinyin: "tai yuan shi"
        },
        {
            id: 301,
            city: "长治市",
            pinyin: "chang zhi shi"
        },
        {
            id: 302,
            city: "大同市",
            pinyin: "da tong shi"
        },
        {
            id: 303,
            city: "晋城市",
            pinyin: "jin cheng shi"
        },
        {
            id: 304,
            city: "晋中市",
            pinyin: "jin zhong shi"
        },
        {
            id: 305,
            city: "临汾市",
            pinyin: "lin fen shi"
        },
        {
            id: 306,
            city: "吕梁市",
            pinyin: "lv liang shi"
        },
        {
            id: 307,
            city: "朔州市",
            pinyin: "shuo zhou shi"
        },
        {
            id: 308,
            city: "忻州市",
            pinyin: "xin zhou shi"
        },
        {
            id: 309,
            city: "阳泉市",
            pinyin: "yang quan shi"
        },
        {
            id: 310,
            city: "运城市",
            pinyin: "yun cheng shi"
        },
        {
            id: 311,
            city: "西安市",
            pinyin: "xi an shi"
        },
        {
            id: 312,
            city: "安康市",
            pinyin: "an kang shi"
        },
        {
            id: 313,
            city: "宝鸡市",
            pinyin: "bao ji shi"
        },
        {
            id: 314,
            city: "汉中市",
            pinyin: "han zhong shi"
        },
        {
            id: 315,
            city: "商洛市",
            pinyin: "shang luo shi"
        },
        {
            id: 316,
            city: "铜川市",
            pinyin: "tong chuan shi"
        },
        {
            id: 317,
            city: "渭南市",
            pinyin: "wei nan shi"
        },
        {
            id: 318,
            city: "咸阳市",
            pinyin: "xian yang shi"
        },
        {
            id: 319,
            city: "延安市",
            pinyin: "yan an shi"
        },
        {
            id: 320,
            city: "榆林市",
            pinyin: "yu lin shi"
        },
        {
            id: 322,
            city: "成都市",
            pinyin: "cheng du shi"
        },
        {
            id: 323,
            city: "绵阳市",
            pinyin: "mian yang shi"
        },
        {
            id: 324,
            city: "阿坝藏族羌族自治州",
            pinyin: "a ba shi"
        },
        {
            id: 325,
            city: "巴中市",
            pinyin: "ba zhong shi"
        },
        {
            id: 326,
            city: "达州市",
            pinyin: "da zhou shi"
        },
        {
            id: 327,
            city: "德阳市",
            pinyin: "de yang shi"
        },
        {
            id: 328,
            city: "甘孜藏族自治州",
            pinyin: "Gan Zi Cang Zu Zi Zhi Zhou "
        },
        {
            id: 329,
            city: "广安市",
            pinyin: "guang an shi"
        },
        {
            id: 330,
            city: "广元市",
            pinyin: "guang yuan shi"
        },
        {
            id: 331,
            city: "乐山市",
            pinyin: "le shan shi"
        },
        {
            id: 332,
            city: "凉山彝族自治州",
            pinyin: "liang shan shi"
        },
        {
            id: 333,
            city: "眉山市",
            pinyin: "mei shan shi"
        },
        {
            id: 334,
            city: "南充市",
            pinyin: "nan chong shi"
        },
        {
            id: 335,
            city: "内江市",
            pinyin: "nei jiang shi"
        },
        {
            id: 336,
            city: "攀枝花市",
            pinyin: "pan zhi hua shi"
        },
        {
            id: 337,
            city: "遂宁市",
            pinyin: "sui ning shi"
        },
        {
            id: 338,
            city: "雅安市",
            pinyin: "ya an shi"
        },
        {
            id: 339,
            city: "宜宾市",
            pinyin: "yi bin shi"
        },
        {
            id: 340,
            city: "资阳市",
            pinyin: "zi yang shi"
        },
        {
            id: 341,
            city: "自贡市",
            pinyin: "zi gong shi"
        },
        {
            id: 342,
            city: "泸州市",
            pinyin: "lu zhou shi"
        },
        {
            id: 344,
            city: "拉萨市",
            pinyin: "la sa shi"
        },
        {
            id: 345,
            city: "阿里地区",
            pinyin: "A Li Di Qu "
        },
        {
            id: 346,
            city: "昌都地区",
            pinyin: "Chang Du Di Qu "
        },
        {
            id: 347,
            city: "林芝地区",
            pinyin: "Lin Zhi Di Qu "
        },
        {
            id: 348,
            city: "那曲地区",
            pinyin: "Na Qu Di Qu "
        },
        {
            id: 349,
            city: "日喀则市",
            pinyin: "ri ka ze shi"
        },
        {
            id: 350,
            city: "山南地区",
            pinyin: "Shan Nan Di Qu "
        },
        {
            id: 351,
            city: "乌鲁木齐市",
            pinyin: "wu lu mu qi shi"
        },
        {
            id: 352,
            city: "阿克苏地区",
            pinyin: "A Ke Su Di Qu "
        },
        {
            id: 353,
            city: "阿拉尔市",
            pinyin: "a la er shi"
        },
        {
            id: 354,
            city: "巴音郭楞蒙古自治州",
            pinyin: "Ba Yin Guo Leng Meng Gu Zi Zhi Zhou "
        },
        {
            id: 355,
            city: "博尔塔拉蒙古自治州",
            pinyin: "Bo Er Ta La Meng Gu Zi Zhi Zhou "
        },
        {
            id: 356,
            city: "昌吉回族自治州",
            pinyin: "Chang Ji Hui Zu Zi Zhi Zhou "
        },
        {
            id: 357,
            city: "哈密地区",
            pinyin: "Ha Mi Di Qu "
        },
        {
            id: 358,
            city: "和田地区",
            pinyin: "He Tian Di Qu "
        },
        {
            id: 359,
            city: "喀什地区",
            pinyin: "Ka Shi Di Qu "
        },
        {
            id: 360,
            city: "克拉玛依市",
            pinyin: "ke la ma yi shi"
        },
        {
            id: 361,
            city: "克孜勒苏柯尔克孜自治州",
            pinyin: "Ke Zi Le Su Ke Er Ke Zi Zi Zhi Zhou "
        },
        {
            id: 362,
            city: "石河子市",
            pinyin: "shi he zi shi"
        },
        {
            id: 363,
            city: "图木舒克市",
            pinyin: "tu mu shu ke shi"
        },
        {
            id: 364,
            city: "吐鲁番地区",
            pinyin: "Tu Lu Fan Di Qu "
        },
        {
            id: 365,
            city: "五家渠市",
            pinyin: "wu jia qu shi"
        },
        {
            id: 366,
            city: "伊犁哈萨克自治州",
            pinyin: "Yi Li Ha Sa Ke Zi Zhi Zhou "
        },
        {
            id: 367,
            city: "昆明市",
            pinyin: "kun ming shi"
        },
        {
            id: 368,
            city: "怒江傈僳族自治州",
            pinyin: "Nu Jiang Li Su Zu Zi Zhi Zhou "
        },
        {
            id: 369,
            city: "普洱市",
            pinyin: "pu er shi"
        },
        {
            id: 370,
            city: "丽江市",
            pinyin: "li jiang shi"
        },
        {
            id: 371,
            city: "保山市",
            pinyin: "bao shan shi"
        },
        {
            id: 372,
            city: "楚雄彝族自治州",
            pinyin: "Chu Xiong Yi Zu Zi Zhi Zhou "
        },
        {
            id: 373,
            city: "大理白族自治州",
            pinyin: "Da Li Bai Zu Zi Zhi Zhou "
        },
        {
            id: 374,
            city: "德宏傣族景颇族自治州",
            pinyin: "De Hong Dai Zu Jing Po Zu Zi Zhi Zhou "
        },
        {
            id: 375,
            city: "迪庆藏族自治州",
            pinyin: "Di Qing Cang Zu Zi Zhi Zhou "
        },
        {
            id: 376,
            city: "红河哈尼族彝族自治州",
            pinyin: "hong he shi"
        },
        {
            id: 377,
            city: "临沧市",
            pinyin: "lin cang shi"
        },
        {
            id: 378,
            city: "曲靖市",
            pinyin: "qu jing shi"
        },
        {
            id: 379,
            city: "文山壮族苗族自治州",
            pinyin: "Wen Shan Zhuang Zu Miao Zu Zi Zhi Zhou "
        },
        {
            id: 380,
            city: "西双版纳傣族自治州",
            pinyin: "Xi Shuang Ban Na Dai Zu Zi Zhi Zhou "
        },
        {
            id: 381,
            city: "玉溪市",
            pinyin: "yu xi shi"
        },
        {
            id: 382,
            city: "昭通市",
            pinyin: "zhao tong shi"
        },
        {
            id: 383,
            city: "杭州市",
            pinyin: "hang zhou shi"
        },
        {
            id: 384,
            city: "湖州市",
            pinyin: "hu zhou shi"
        },
        {
            id: 385,
            city: "嘉兴市",
            pinyin: "jia xing shi"
        },
        {
            id: 386,
            city: "金华市",
            pinyin: "jin hua shi"
        },
        {
            id: 387,
            city: "丽水市",
            pinyin: "li shui shi"
        },
        {
            id: 388,
            city: "宁波市",
            pinyin: "ning bo shi"
        },
        {
            id: 389,
            city: "绍兴市",
            pinyin: "shao xing shi"
        },
        {
            id: 390,
            city: "台州市",
            pinyin: "tai zhou shi"
        },
        {
            id: 391,
            city: "温州市",
            pinyin: "wen zhou shi"
        },
        {
            id: 392,
            city: "舟山市",
            pinyin: "zhou shan shi"
        },
        {
            id: 393,
            city: "衢州市",
            pinyin: "qu zhou shi"
        },
        {
            id: 500,
            city: "北京市",
            pinyin: "bei jing sheng"
        },
        {
            id: 2703,
            city: "上海市",
            pinyin: "shang hai sheng"
        },
        {
            id: 2912,
            city: "天津市",
            pinyin: "tian jin sheng"
        },
        {
            id: 3325,
            city: "重庆市",
            pinyin: "chong qing sheng"
        },
        {
            id: 3401,
            city: "合肥市",
            pinyin: "he fei shi"
        },
        {
            id: 3412,
            city: "昆山市",
            pinyin: "kun shan shi"
        },
        {
            id: 3414,
            city: "丰城市",
            pinyin: "Feng Cheng Shi Shi Shi Shi Shi "
        },
        {
            id: 3417,
            city: "襄阳市",
            pinyin: "xiang yang shi"
        },
        {
            id: 3418,
            city: "恩施土家族苗族自治州",
            pinyin: "en shi tu jia zu miao zu zi zhi zhou "
        }
    ]
};
function _formatCityList(arr) {
    var letterArr = {};
        for (var i = 0; i < arr.length; i++) {
            let key=arr[i]['pinyin'].slice(0,1).toUpperCase()
            if (!(key in letterArr)) {
                letterArr[key] = [];
                letterArr[key].push(arr[i]);
            } else {
                letterArr[key].push(arr[i]);
            }
        }
    return letterArr

}

(function ($, win, doc) {
    var CityPicker = function (el, options) {
        this.el = $(el);
        this.options = options;
        this.provinces = _formatCityList(provinces.citys);
        this.pro = null;
        this.city = null;
        this.elType = this.el.is('input');

        this.init();
    };

    var p = CityPicker.prototype;

    p.init = function () {
        this.initEvent();
        this.preventPopKeyboard();

    };

    p.preventPopKeyboard = function () {
        if (this.elType) {
            this.el.prop("readonly", true);
        }
    };

    p.initEvent = function () {
        this.el.on("focus", function (e) {
            var pickerBox = $(".picker-box");
            if (pickerBox[0]) {
                pickerBox.show();
            } else {
                this.create();
            }
        }.bind(this));
    };

    p.create = function () {
        this.createCityPickerBox();
        this.createProList();
        this.proClick();
        this.createNavBar();
        this.navEvent();
    };

    p.createCityPickerBox = function () {
        var proBox = "<div class='picker-box'></div>";
        $("body").append(proBox);
    };

    p.createProList = function () {
        var provinces = this.provinces;
        var proBox;
        var dl = "";
        for (var letterKey in provinces) {
            var val = provinces[letterKey];
            if (provinces.hasOwnProperty(letterKey)) {
                var dt = "<dt id='" + letterKey + "'>" + letterKey + "</dt>";
                var dd = "";
                for (var proKey in val) {
                    console.log(val)
                    if (val.hasOwnProperty(proKey)) {
                        dd += "<dd data-letter=" + val[proKey].id + ">" + val[proKey].city + "</dd>";
                    }
                }
                dl += "<dl>" + dt + dd + "</dl>";
            }
        }

        proBox = "<section class='pro-picker'>" + dl + "</section>";

        $(".picker-box").append(proBox);
    };

    p.createCityList = function (letter, pro) {
        var cities = this.provinces[letter][pro];
        var ul, li = "";
        cities.forEach(function (city, i) {
            li += "<li>" + city + "</li>";
        });

        ul = "<ul class='city-picker'>" + li + "</ul>";
        $(".picker-box").find(".city-picker").remove().end().append(ul);

        this.cityClick();
    };

    p.proClick = function () {
        var that = this;
        $(".pro-picker").on("click", function (e) {
            var target = e.target;
            if ($(target).is("dd")) {
                that.pro = $(target).html();
                var letter = $(target).data("letter");
                console.log(letter)
                //that.createCityList(letter, that.pro);

                //$(this).hide();
            }
        });
    };

    p.cityClick = function () {
        var that = this;
        $(".city-picker").on("click", function (e) {
            var target = e.target;
            if ($(target).is("li")) {
                that.city = $(target).html();
                if (that.elType) {
                    that.el.val(that.pro + "-" + that.city);
                } else {
                    that.el.html(that.pro + "-" + that.city);
                }

                $(".picker-box").hide();
                $(".pro-picker").show();
                $(this).hide();
            }
        });
    };

    p.createNavBar = function () {
        var str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        var arr = str.split("");
        var a = "";
        arr.forEach(function (item, i) {
            a += '<a href="#' + item + '">' + item + '</a>';
        });

        var div = '<div class="navbar">' + a + '</div>';

        $(".picker-box").append(div);
    };

    p.navEvent = function () {
        var that = this;
        var navBar = $(".navbar");
        var width = navBar.find("a").width();
        var height = navBar.find("a").height();
        navBar.on("touchstart", function (e) {
            //$(this).addClass("active");
            that.createLetterPrompt($(e.target).html());
        });

        navBar.on("touchmove", function (e) {
            e.preventDefault();
            var touch = e.originalEvent.touches[0];
            var pos = {"x": touch.pageX, "y": touch.pageY};
            var x = pos.x, y = pos.y;
            $(this).find("a").each(function (i, item) {
                var offset = $(item).offset();
                var left = offset.left, top = offset.top;
                if (x > left && x < (left + width) && y > top && y < (top + height)) {
                    location.href = item.href;
                    that.changeLetter($(item).html());
                }
            });
        });

        navBar.on("touchend", function () {
            $(this).removeClass("active");
            $(".prompt").hide();
        })
    };

    p.createLetterPrompt = function (letter) {
        var prompt = $(".prompt");
        if (prompt[0]) {
            prompt.show();
        } else {
            var span = "<span class='prompt'>" + letter + "</span>";
            $(".picker-box").append(span);
        }
    };


    p.changeLetter = function (letter) {
        var prompt = $(".prompt");
        prompt.html(letter);
    };

    $.fn.CityPicker = function (options) {
        console.log(options)
        return new CityPicker(this, options);
    }
}(window.jQuery, window, document));
